package edu.hunau.recommend.common;

import com.sun.net.httpserver.Authenticator;

/**
 * 定义响应的相关信息
 * @author name
 * @creater 2022-09-08-21:37
 */
public enum ResultCodeEnum {
    //成功响应
    SUCCESS(true, 20000, "成功"),
    //未知错误
    UNKNOWN_ERROR(false,40000,"未知错误"),
    //
    NULL_POINT(false,40001,"参数为空"),
    //请求错误
    NO_HANDLER_FOUND(false,40002,"请求不存在"),
    //用户名重复
    REGIST_DUP_FAIL(false,40003,"用户名重复"),

    REQUEST_PARAM_ERROR(false,40004,"请求参数异常"),

    LOGIN_FAIL(false,40005,"用户名或者密码错误"),

    ADMIN_SHOULD_LOGIN(false, 40006, "管理员应先登录");

    private Boolean success;
    private Integer code;
    private String message;

    ResultCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
